import { getWareHouseSearchList } from '@/api/basicData/warehouse/warehouse.js'

export const wareHouseSelect1 = {
  data() {
    return {
      // 供应商列表表头信息
      wareHouseTableKeys1: [
        {
          width: 200,
          key: 'warehouseName',
          title: '仓库名称'
        },
        {
          width: 200,
          key: 'remark',
          title: '备注'
        }
      ]
    }
  },
  methods: {
    /*    弹窗组件自定义事件    */
    getWareHouseSearchList1({ pageNum, pageSize, keyWord }) {
      // 查询列表
      getWareHouseSearchList({
        pageNum, pageSize, keyWord
      }).then(resp => {
        let wareHouseList = resp.rows || []
        let total = resp.total
        // 数据回传
        this.$refs.WareHouseSearch1.receive(wareHouseList, total)
      })
    },
    updateQueryParamsForWareHouse1(warehouseId) {
      this.queryParams.warehouseId = warehouseId
      this.getList()
    },
    selectDialogItemForWareHouse1({ warehouseName }) {
      this.$refs.WareHouseSearch1.formItemKeyWord = warehouseName
    }
  }
}

